
export const dateFormatYMD = (time) => {
    var t = new Date(time);
    var tf = function(i){return (i < 10 ? '0' : '') + i};
    return tf(t.getFullYear())+'-'+ tf(t.getMonth() + 1)+'-'+tf(t.getDate());
};


export const dateFormatYMDHD = (time) => {
  var t = new Date(time);
  var tf = function(i){return (i < 10 ? '0' : '') + i};
  return tf(t.getFullYear())+'-'+ tf(t.getMonth() + 1)+'-'+tf(t.getDate())+' '+tf(t.getHours())+':'+tf(t.getMinutes()) ;
};


export const dateForward = (days) => {    //前推 days天
    var date = new Date();
    return date.setDate(date.getDate() - days);
};


export const isReview=(label,i)=>{  //审核状态    label-->字段  i-->值
  switch (i){
    case 0:label="未通过";break;
    case 1:label="通过";break;
  }
};

export const isFocus=(label,i)=>{   //焦点消息
  switch (i){
    case 0:label="否";break;
    case 1:label="是";break;
  }
};

export const msgStatus=(label,i)=>{  //消息状态
  switch (i){
    case  0:label="待发送";break;
    case  1:label="已发送";break;
    case -1:label="已删除";break;
  }
};


